<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>2-键盘事件对象属性</title>
	</head>
	<body>
		<script type="text/javascript">
			document.addEventListener('keydown',function(e){
				//e事件对象
				console.log(e);
				if(e.keyCode==81){
					alert('你按了Q大写');
				}else{
					alert('按了其它键');
				}
			})
		</script>
	</body>
</html>
